<?php

// Basic operators

declare(strict_types=1);

use Tester\Assert;

require __DIR__ . '/../bootstrap.php';

$test = <<<'XX'
	$a ** $b,

	++$a,
	--$a,
	$a++,
	$a--,

	@$a,
	~$a,
	-$a,
	+$a,

	(int) $a,
	(float) $a,
	( float) $a,
	(string) $a,
	(array) $a,
	(object) $a,
	(bool) $a,

	$a * $b,
	$a / $b,
	$a % $b,
	$a + $b,
	$a - $b,
	$a . $b,
	$a << $b,
	$a >> $b,
	$a < $b,
	$a <= $b,
	$a > $b,
	$a >= $b,
	$a == $b,
	$a != $b,
	$a <> $b,
	$a === $b,
	$a !== $b,
	$a <=> $b,
	$a | 1,
	$a & $b,
	$a ^ $b,
	$a && $b,
	$a || $b,
	$a ? $b : $c,
	$a ?: $c,
	$a ?? $c,
	$a = $b,
	$a **= $b,
	$a ??= $c,
	$a *= $b,
	$a /= $b,
	$a %= $b,
	$a += $b,
	$a -= $b,
	$a .= $b,
	$a <<= $b,
	$a >>= $b,
	$a &= $b,
	$a ^= $b,
	$a |= $b,
	$a =& $b,

	$a and $b,
	$a xor $b,
	$a or $b,

	$a instanceof Foo,
	$a instanceof $b,

	$a in $b,

	$a |> $b |> $c,
	$a |> $b == $c,
	$c == $a |> $b,
	($a == $b) |> ($c == $d),
	$a . ($b |> $c) . $d,
	XX;

$node = parseCode($test);
$code = printNode($node);

Assert::same(
	loadContent(__FILE__, __COMPILER_HALT_OFFSET__),
	$code,
);

__halt_compiler();
$a ** $b,
++$a,
--$a,
$a++,
$a--,
@$a,
~$a,
-$a,
+$a,
(int) $a,
(float) $a,
(float) $a,
(string) $a,
(array) $a,
(object) $a,
(bool) $a,
$a * $b,
$a / $b,
$a % $b,
$a + $b,
$a - $b,
$a . $b,
$a << $b,
$a >> $b,
$a < $b,
$a <= $b,
$a > $b,
$a >= $b,
$a == $b,
$a != $b,
$a != $b,
$a === $b,
$a !== $b,
$a <=> $b,
$a | 1,
$a & $b,
$a ^ $b,
$a && $b,
$a || $b,
$a ? $b : $c,
$a ?: $c,
$a ?? $c,
$a = $b,
$a **= $b,
$a ??= $c,
$a *= $b,
$a /= $b,
$a %= $b,
$a += $b,
$a -= $b,
$a .= $b,
$a <<= $b,
$a >>= $b,
$a &= $b,
$a ^= $b,
$a |= $b,
$a = &$b,
$a and $b,
$a xor $b,
$a or $b,
$a instanceof Foo,
$a instanceof $b,
in_array($a, $b, true),
$a |> $b |> $c,
$a |> $b == $c,
$c == $a |> $b,
($a == $b) |> ($c == $d),
$a . ($b |> $c) . $d
